<template>
  <div class="pt">
    <van-card
      v-for="item in list"
      :key="item.id"
      :price="item.price"
      :title="item.title"
      :thumb="item.image"
      @click="aaa(item.id)"
    >
    <template #desc>
        <div>
          <p class="old">{{item.otPrice}}</p>
        </div>
      </template>
    
    </van-card>
  </div>
</template>
<script>
export default {
  props:["list"],
  data() {
    return {
      
    };
  },
  methods: {
    aaa(id) {
     this.$router.push(`/goods_combination_details/index?id=${id}`)
    }
  },
  created() {
    
  },
  // 监听传过来的数据
  watch:{
    list(newval,oldval){
      if(newval){
        this.list=newval
        // console.log(this.list);
      }
    }
  }
};
</script>
<style lang="scss">
.pt {
  width: 90%;
  margin: 0 auto;
  .van-card {
    border-radius: 5px;
    margin: 5% auto;
    .van-card__header {
      .van-card__thumb {
        .van-image {
          img {
            width: 100%;
            height: 100%;
          }
        }
      }
      .van-card__content {
        .van-card__bottom {
          .van-card__price {
            div{
              color: red;
              
            .van-card__price-integer {
              
              font-size: 18px;
            }
            }
          }
        }
      }
    }
  }
  .old {
    text-decoration: line-through;
  }
}
</style>